<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:import href="../utilities/master-calendar.xsl"/>
<xsl:import href="../utilities/date-and-time.xsl"/>
<xsl:import href="../utilities/get-admin-menu.xsl"/>
<xsl:import href="../utilities/get-admin-archives.xsl"/>
<xsl:import href="../utilities/admin-pagination.xsl"/>


<xsl:template match="data">
	<div class="grid_16" id="admin">
		<xsl:choose>
			<xsl:when test="/data/clients/entry/administrator = 'Yes'">
				<div class="grid_5 alpha">
					<xsl:call-template name="admin-menu"/>
				</div>
				<div class="grid_11 omega" id="archives">
					<h2>Client Payment Management</h2>
					<div id="archives-filter" class="grid_6 alpha">
						<em>Filter by client: </em>
						<label>
							<xsl:apply-templates select="/data/admin-clients" mode="admin-archives-client-list"/>
						</label>
							<!--xsl:text> </xsl:text>
							<em>and/or</em>
							<xsl:text> </xsl:text>
						<label>
							<xsl:apply-templates select="/data/admin-clients" mode="admin-archives-payment-status-list"/>
						</label>
						<xsl:text> </xsl:text>
						<strong id="filter">Filter</strong-->
					</div>
					<div id="pagination" class="grid_4 omega">
						<xsl:call-template name="pagination">
							<xsl:with-param name="pagination-element" select="admin-appointments/pagination"/>
							<xsl:with-param name="url" select="$root"/>
							<xsl:with-param name="display-number" select="5"/>
						</xsl:call-template>
					</div>
					<xsl:choose>
						<!--xsl:when test="$entry-id != '' and $payment != ''">
							<div id="admin_main">
								<xsl:apply-templates select="admin-appointments" mode="admin-archives-both"/>
							</div>
						</xsl:when-->
						<xsl:when test="$entry-id != ''">
							<div id="admin_main" class="grid_12">
								<xsl:apply-templates select="admin-appointments" mode="admin-archives-client"/>
							</div>
						</xsl:when>
						<xsl:when test="$entry-id = 'clients' and $payment != ''">
							<div id="admin_main" class="grid_12">
								<xsl:apply-templates select="admin-appointments" mode="admin-archives-payment"/>
							</div>
						</xsl:when>
						<xsl:when test="$entry-id = 'clients' or $entry-id = ''">
							<div id="admin_main" class="grid_12">
								<xsl:apply-templates select="admin-appointments" mode="admin-archives-all"/>
							</div>
						</xsl:when>
						<xsl:when test="number($entry-id) &gt; 0">
							<div id="admin_main" class="grid_12">
								<xsl:apply-templates select="admin-appointments" mode="admin-archives-client"/>
							</div>
						</xsl:when>
					</xsl:choose>
					<div id="pagination" class="grid_4 omega">
						<xsl:call-template name="pagination">
							<xsl:with-param name="pagination-element" select="admin-appointments/pagination"/>
							<xsl:with-param name="url" select="$root"/>
							<xsl:with-param name="display-number" select="5"/>
						</xsl:call-template>
					</div>
					<!--div>
						<xsl:call-template name="pagination">
							<xsl:with-param name="pagination-element" select="past-client-appointments-long/pagination"/>
							<xsl:with-param name="url" select="$root"/>
							<xsl:with-param name="display-number" select="5"/>
						</xsl:call-template>
					</div-->
				</div>
			</xsl:when>
		</xsl:choose>
		
	</div>
	
</xsl:template>



</xsl:stylesheet>